<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>测试图表</title>
</head>
<body>
<div id="main" style="width: 500px;height:400px; background-color: cornsilk"></div>
<script src="../static/lib/echarts-5.4.3.min.js"></script>
<script type="text/javascript">
    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom);
    var option;
    option = {
        tooltip: {
            trigger: 'item'
        },
        legend: {
            top: '5%',
            left: 'center'
        },
        color:['#5470c6', '#91cc75', '#fac858', '#ee6666', '#73c0de', '#3ba272', '#fc8452', '#9a60b4', '#ea7ccc', '#57f1bf'],
        series: [
            {
                name: 'Access From',
                type: 'pie',
                radius: ['40%', '70%'],
                avoidLabelOverlap: true,
                itemStyle: {
                    borderRadius: 10,
                    borderColor: '#fff',
                    borderWidth: 2
                },
                label: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    label: {
                        show: true,
                        fontSize: 40,
                        fontWeight: 'bold'
                    }
                },
                labelLine: {
                    show: false
                },
                data: [
                    {value: 1048, name: '常用推荐'},
                    {value: 735, name: '站长相关'},
                    {value: 580, name: '学习教育'},
                    {value: 484, name: '生活服务'},
                    {value: 300, name: '工具大全'},
                    {value: 1048, name: '软件大全'},
                    {value: 735, name: '软件资源'},
                    {value: 580, name: '科技生活'},
                    {value: 484, name: '高效办公'},
                    {value: 300, name: '设计素材'},
                    {value: 300, name: '聚合导航'}
                ]
            }
        ]
    };
    option && myChart.setOption(option);
</script>
</body>
</html>